const express = require('express')
const app = express()
const port = 3000

app.get('/', (req, res) => {
  res.send('Hello World!')
})


app.get('/login', (req, res) => {
  console.log(req.query)
  res.header('Access-Control-Allow-Origin', '*')
  var name = req.query.uname;
  var pass = req.query.pword;
  if (name == "zhangsan" && pass == "123") {
    res.send("1")
  } else {
    res.send("0")
  }
})
//   get post
app.listen(port, () => {
  console.log(`Example app listening on port ${port}`)
})